<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login Page</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f4; /* Light background for contrast */
        }

        .container {
            width: 300px;
            margin: 100px auto;
            background-color: white; /* White background for the form */
            padding: 20px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            border-radius: 5px;
        }
        h2 {
            text-align: center;
            color: #333; /* Darker text for contrast */
        }
        label {
            display: block;
            margin: 10px 0 5px;
        }
        input[type="text"], input[type="password"] {
            width: 100%;
            padding: 10px 5px;
            margin: 10px 0px;
            border: 1px solid #ccc;
            border-radius: 3px;
        }
        button {
            width: 100%;
            padding: 10px;
            background-color: #4CAF50; /* Same button color */
            color: white;
            border: none;
            border-radius: 3px;
            cursor: pointer;
        }
        button:hover {
            background-color: #45a049; /* Darker green on hover */
        }

    </style>
</head>
<body>
<div class="container">
    <h2>登录</h2>
    <form method="post">
        {% csrf_token %}
        <label for="username">用户名:</label>
        <input type="text" name="username" required>
        <br>
        <label for="password">密码:</label>
        <input type="password" name="password" required>
        <br>
        <button type="submit">登录</button>
    </form>
    {% if error %}
        <p style="color:red;">{{ error }}</p>
    {% endif %}
</div>
</body>
</html>